// 统一请求路径前缀在libs/axios.js中修改
import {
  getRequest,
  postRequest,
  putRequest,
  oauthTokenLogin,
  importRequest,
  getRequestWithNoToken,
} from "@/utils/SaaSAxios";

// Websocket
export const ws =
  `${process.env.NODE_ENV === "production" ? "" : "/proxyLS"}` +
  "/yl1001/platform/api/message/ws";

//绘制验证码
export const drawCodeImage =
  `${process.env.NODE_ENV === "production" ? "" : "/proxyLS"}` +
  "/yl1001/platform/api/user/drawCaptcha/";
export const previewImage =
  `${process.env.NODE_ENV === "production" ? "" : "/proxyLS"}` +
  "/yl1001/platform/api/saas/upload/image";

//SaaS登录
export function SaaSUserLogin(params) {
  return postRequest("/user/login", params);
}
//SaaS登录
export function SaaSUserSmsLogin(params) {
  return postRequest("/user/smsLogin", params);
} // 过期登录
export const expiredLogin = (params) => {
  return postRequest(`/user/expiredLogin`, params);
};
//SaaS用户信息
export function SaaSUserInfo(params) {
  return getRequest("/user/info", params);
}
//SaaS用户退出
export function SaaSUserLogout(params) {
  return getRequest("/user/logout", params);
}
//SaaS验证码
export function SaaSInitCaptcha(params) {
  return getRequest("/user/initCaptcha", params);
}
//SaaS验证码
export function SaaSChangePassword(params) {
  return getRequest("/user/changePassword", params);
}
// 判断登录是否过期
export const reqIsExpired = (params) => {
  return getRequest(`/user/isExpired`, params);
};
// 根据用户名获取手机号短信
export const sendMsgByCode = (params) => {
  return postRequest(`/user/sendMsgByCode`, params);
};
//获取手机号短信
export const sendMsg = (params) => {
  return postRequest(`/user/sendMsg`, params);
};
// 根据用户名获取手机号短信
export const sendMsgByu = (params) => {
  return postRequest(`/user/sendMsgByu`, params);
};
